import { division } from "../utils";

export function option1({ minSize,data}) {
    const option = {
        color: ['#2b9cdf', '#e75b2e'],
        legend: {
            show: false,
            orient: 'horizontal',
            left: 'center',
            data: ['CLI'],
            textStyle: {
                color: '#fff'
            },
            icon: 'path://M512 0c282.752 0 512 229.248 512 512s-229.248 512-512 512S0 794.752 0 512 229.248 0 512 0z m0 85.333333C276.352 85.333333 85.333333 276.352 85.333333 512s191.018667 426.666667 426.666667 426.666667 426.666667-191.018667 426.666667-426.666667S747.648 85.333333 512 85.333333z m0 213.333334a213.333333 213.333333 0 1 1 0 426.666666 213.333333 213.333333 0 0 1 0-426.666666z'
        },
        series: [{
            name: '',
            type: 'funnel',
            sort: 'descending',
            minSize:minSize,
            data: data,
            gap: 10,
            z:2,
            lineStyle: {
                color: '#00f0ff',
                shadowColor: '#000',
                shadowBlur: 10,
                shadowOffsetY: 5
            },
            label: {
                normal: {
                    show: true,
                    position: 'right',
                    color: '#707475'
                },
            },
            labelLine:{
                show:false
            },
            itemStyle: {
                color:{
                    type: 'lineal',
                    x: 1,
                    y: 1,
                    x2:0,
                    y2:1,
                    colorStops: [{
                        offset: 0, color: '#044b98'
                    }, {
                        offset: 0.5, color: '#067eff'
                    }, {
                        offset: 1, color: '#044b98'
                    }]
                },
                borderWidth:0
            }
        },{
            name: '',
            type: 'funnel',
            sort: 'descending',
            minSize:minSize,
            data: data,
            gap: 10,
            lineStyle: {
                color: '#00f0ff',
                shadowColor: '#000',
                shadowBlur: 10,
                shadowOffsetY: 5
            },
            label: {
                normal: {
                    show: true,
                    formatter:(p)=>{
                        return division(p.value?''+p.value:'');
                    },
                    position: 'inside',
                    color: '#fff'
                },

            },
            itemStyle: {
                color:{
                    type: 'lineal',
                    x: 1,
                    y: 1,
                    x2:0,
                    y2:1,
                    colorStops: [{
                        offset: 0, color: '#044b98'
                    }, {
                        offset: 0.5, color: '#067eff'
                    }, {
                        offset: 1, color: '#044b98'
                    }]
                },
                borderWidth:0
            }
        }]
    }
    return option;
}

